package com.jp.knowledge.my.adapter;

import android.content.Context;
import android.support.annotation.NonNull;

import com.jp.knowledge.R;
import com.jp.knowledge.my.base.RecycleVAdapter;
import com.jp.knowledge.my.base.RecycleVHolder;
import com.jp.knowledge.my.model.ActiveDataModel;

import java.util.List;

/**
 * @author gzejia 978862664@qq.com
 */
public class MyFranchiseAdapter extends RecycleVAdapter<ActiveDataModel> {

    public MyFranchiseAdapter(Context context, @NonNull List<ActiveDataModel> list) {
        super(context, list);
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_my_franchise;
    }

    @Override
    public void onBind(RecycleVHolder holder, int position) {
        ActiveDataModel model = getData(position);
        holder.setTextView(R.id.my_item_tv_unit, model.mUnit);
        holder.setTextView(R.id.my_item_tv_type, model.mName);
        holder.setTextView(R.id.my_item_tv_number,
                model.mIndex < 0 ? "N" : String.valueOf(model.mIndex));
    }
}

